﻿using System;

namespace Apex.EventBus.EventBuses
{
    public interface IEventBus
    {
        /// <summary>
        /// 发布事件
        /// </summary>
        /// <param name="eventName">事件名称</param>
        /// <param name="eventData">事件数据</param>
        void Publish(string eventName, object? eventData);
        /// <summary>
        /// 订阅事件
        /// </summary>
        /// <param name="eventName">事件名称</param>
        /// <param name="handlerType">处理事件程序</param>
        void Subscribe(string eventName, Type handlerType);
        /// <summary>
        /// 取消订阅事件
        /// </summary>
        /// <param name="eventName">事件名称</param>
        /// <param name="handlerType">处理事件程序</param>
        void Unsubscribe(string eventName, Type handlerType);
    }
}
